home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / prog / dnalib59.arj / SAVEREST.BAS < prev    next >
BASIC Source File  |  1993-12-13  |  1KB  |  59 lines

  1. SUB SaveScreen(ScreenID$,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Shadow%) PUBLIC
  2.  
  3. DEF SEG = &HB800
  4.  
  5. ScreenID$ = ""
  6.  
  7. Rc% = RightColumn%
  8. Br% = BottomRow%
  9.  
  10. IF Shadow% = 1 THEN
  11.   INCR Rc%,2
  12.   INCR Br%
  13. END IF
  14.  
  15. Amount% = ((Rc% - LeftColumn%) * 2) + 2
  16.  
  17. FOR i% = TopRow% TO Br% STEP 1
  18.   Start% = ((i% - 1) * 160) + (LeftColumn% * 2) - 2
  19.   a$ = PEEK$(Start%,Amount%)
  20.   ScreenID$ = ScreenID$ + a$ + CHR$(255)
  21. NEXT i%
  22.  
  23. StringWidth$ = STR$(Amount%)
  24.  
  25. IF LEN(StringWidth$) > 3 THEN
  26.   StringWidth$ = LTRIM$(StringWidth$)
  27. ELSE
  28.   j% = 3 - LEN(StringWidth$)
  29.   StringWidth$ = SPACE$(j%) + StringWidth$
  30. END IF
  31.  
  32. ScreenID$ = StringWidth$ + ScreenID$
  33.  
  34. DEF SEG
  35.  
  36. END SUB
  37.  
  38. SUB RestoreScreen(ScreenID$,TopRow%,LeftColumn%) PUBLIC
  39.  
  40.  
  41. a$ = LEFT$(ScreenID$,3)                                 'get the 3 numbers from the string
  42. Divisor% = VAL(a$)                            'convert them to an integer
  43. TempScreen$ = LTRIM$(ScreenID$,a$)            'remove the extra characters
  44. NumRows% = LEN(TempScreen$) \ (Divisor% + 1)  'divide to find the amount
  45. BottomRow% = (TopRow% + NumRows%) - 1         'of rows
  46.  
  47. DEF SEG = &HB800
  48.  
  49. FOR i% = TopRow% TO BottomRow%
  50.   Start% = ((i% - 1) * 160) + (LeftColumn% * 2) - 2
  51.   b$ = LEFT$(TempScreen$,Divisor%)
  52.   POKE$ Start%,b$
  53.   TempScreen$ = LTRIM$(TempScreen$,b$)
  54.   TempScreen$ = LTRIM$(TempScreen$,CHR$(255))
  55. NEXT i%
  56.  
  57. DEF SEG
  58.  
  59. END SUB